#ifndef URLFILEDEALER_H_
#define URLFILEDEALER_H_

#include <iostream>
#include <list>
#include "URL.h"
#include <ext/hash_map>
#include <string>

class URLFileDealer {
private:
    URLFileDealer() {}
    
public:
    static URLFileDealer &getInstance();
    void std::list <URL> getNewURLs(int quantity);
    void std::list <URL> getVisitedURLs();
    void addToDiskBuffer(URL url) { toDiskBuffer.push_back(url)); }
    virtual ~URLFileDealer(){}
    void initURLHashMap();
    
private:
    static std::auto_ptr<URLFileDealer> theURLFileDealer;
	__gnu_cxx::hash_map<std::string, std::string> urlHashMap;
	std::list <URL> toDiskBuffer;
};

#endif /*URLFILEDEALER_H_*/
